package com.wuliang.common.result;

import lombok.Data;

import java.io.Serializable;

@Data
public class Result implements Serializable {

    private static final long serialVersionUID = 4731981549224710481L;

    /**
     * 返回状态码
     */
    private Integer code; // StateCode
    /**
     * 返回信息
     */
    private String message;
    /**
     * 返回信息
     */
    private Object data;

    public Result(Integer code, String message, Object data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public Result() {
    }

    public static Result SUCCESS(Object data) {
        return new Result(StateCode.SUCCESS, "执行成功",data);
    }

    public static Result FAIL(Object data) {
        return new Result(StateCode.ERROR, "执行失败",data);
    }



}
